//package webapp.mapperScan.factory;
//
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.springframework.dao.support.DaoSupport;
//import org.springframework.util.Assert;
//
//public abstract class DemoSqlSessionDaoSupport extends DaoSupport {
//    private SqlSessionTemplate sqlSessionTemplate;
//
//    public DemoSqlSessionDaoSupport() {
//    }
//
//    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
//        if (this.sqlSessionTemplate == null || sqlSessionFactory != this.sqlSessionTemplate.getSqlSessionFactory()) {
//            this.sqlSessionTemplate = this.createSqlSessionTemplate(sqlSessionFactory);
//        }
//
//    }
//
//    protected SqlSessionTemplate createSqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
//        return new SqlSessionTemplate(sqlSessionFactory);
//    }
//
//    public final SqlSessionFactory getSqlSessionFactory() {
//        return this.sqlSessionTemplate != null ? this.sqlSessionTemplate.getSqlSessionFactory() : null;
//    }
//
//    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
//        this.sqlSessionTemplate = sqlSessionTemplate;
//    }
//
//    public SqlSession getSqlSession() {
//        return this.sqlSessionTemplate;
//    }
//
//    public SqlSessionTemplate getSqlSessionTemplate() {
//        return this.sqlSessionTemplate;
//    }
//
//    protected void checkDaoConfig() {
//        Assert.notNull(this.sqlSessionTemplate, "Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required");
//    }
//}
